package com.ruoyi.workflow.constants;

/**
 * 业务申请最终状态的常量
 */
public class ApplyStatusConstant {
    /**
     * 审核中
     */
    public static final Integer UNDER_REVIEW = 1;

    /**
     * 已完成
     */
    public static final Integer COMPLETED = 2;

    /**
     * 已驳回
     */
    public static final Integer REJECTED = 3;

    /**
     * 已取消
     */
    public static final Integer CANCEL = 4;

    /**
     * 修改后同意
     */
    public static final Integer MODIFY_APPROVE = 5;

    /**
     * 退回
     */
    public static final Integer BACK = 6;

    public static final String UNDER_REVIEW_STR = "审核中";
    public static final String COMPLETED_STR = "已完成";
    public static final String REJECTED_STR = "已驳回";
    public static final String CANCEL_STR = "已取消";

    /**
     * 根据申请的数字状态获取字符串状态
     * @param appStatus
     * @return
     */
    public static String getApplyStatus(Integer appStatus){
        if(appStatus == ApplyStatusConstant.UNDER_REVIEW){
            return UNDER_REVIEW_STR;
        }else if(appStatus == ApplyStatusConstant.COMPLETED){
            return COMPLETED_STR;
        }else if(appStatus == ApplyStatusConstant.REJECTED){
            return REJECTED_STR;
        }else if(appStatus == ApplyStatusConstant.CANCEL){
            return CANCEL_STR;
        }
        return "未知状态";
    }
}
